package com.prs.crm.domain.cdxh.material;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.BaseEntity;


/**
 * @author LanXiaoGang
 * @E-mail:lan9liang@163.com
 * @qq:7857553326
 * @version 创建时间：2010-12-6 上午10:32:44 简单说明
 */
@Entity
@Table(name = "cdxh_materialprint")
public class MaterialPrint extends BaseEntity {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	
	
    /**
     * 打印编号
     */
	private String materialPrintCode;
	/**
	 * 机号
	 */
	private String materialMachine;
	/**
	 * 班次
	 */
	private String materialClass;
	/**
	 * 合计
	 */
	private Double materialTotal;

	/**
	 * 主管
	 */
	private String materialCharge;
	/**
	 * 技术员
	 */
	private String materialTechnician;

	/**
	 * 生产员
	 */
	private String materialProduction;

	/**
	 * 打印明细
	 */
	@OneToMany(mappedBy = "materialPrint")
	@Cascade({ org.hibernate.annotations.CascadeType.ALL,
			org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
	private Set<MaterialPrintDetail> details;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getMaterialMachine() {
		return materialMachine;
	}

	public void setMaterialMachine(String materialMachine) {
		this.materialMachine = materialMachine;
	}

	public String getMaterialClass() {
		return materialClass;
	}

	public void setMaterialClass(String materialClass) {
		this.materialClass = materialClass;
	}

	public Double getMaterialTotal() {
		return materialTotal;
	}

	public void setMaterialTotal(Double materialTotal) {
		this.materialTotal = materialTotal;
	}

	public String getMaterialCharge() {
		return materialCharge;
	}

	public void setMaterialCharge(String materialCharge) {
		this.materialCharge = materialCharge;
	}

	public String getMaterialTechnician() {
		return materialTechnician;
	}

	public void setMaterialTechnician(String materialTechnician) {
		this.materialTechnician = materialTechnician;
	}

	public String getMaterialProduction() {
		return materialProduction;
	}

	public void setMaterialProduction(String materialProduction) {
		this.materialProduction = materialProduction;
	}

	public Set<MaterialPrintDetail> getDetails() {
		return details;
	}

	public void setDetails(Set<MaterialPrintDetail> details) {
		this.details = details;
	}
	public void addDetail(MaterialPrintDetail detail) {
		if (details == null)
			details = new HashSet<MaterialPrintDetail>();
		detail.setMaterialPrint(this);
		details.add(detail);
	}

	public String getMaterialPrintCode() {
		return materialPrintCode;
	}

	public void setMaterialPrintCode(String materialPrintCode) {
		this.materialPrintCode = materialPrintCode;
	}
	
}
